export const useModel = (props, emit: any, key = 'value') => {
  const vm = getCurrentInstance();
  const _emit = emit || vm?.emit;
  const event = `update:${key}`;
  const proxy = ref(props[key]);
  watch(
    () => props[key],
    (v) => {
      proxy.value = v;
    },
  );
  watch(
    () => proxy.value,
    (v) => {
      _emit(event, v);
    },
  );
  return proxy;
};
